package dao.jpa;

import java.util.List;

import vo.Log;
import dao.LogDAO;

public class LogDAOJpaImpl extends GenericDaoJpaImpl<Log, Long> implements LogDAO {

	public LogDAOJpaImpl() {
		super(Log.class);
	}

	public List<Log> findAll() {
		return super.executeFinder("Log.findAll");
	}

	public List<Log> findAll(int start, int pageSize) {
		return super.executeFinderPage("Log.findAll", start, pageSize);
	}

	public long findTotalCount() {
		return super.executeFinderCount("Log.findTotalCount");
	}

	public List<Log> findByUserIdMessage(long userId, String msg) {
		return super.executeFinder("Log.findByUserIdMessage", userId, msg);
	}

	public List<Log> findByUserIdType(long userId, String type) {
		return super.executeFinder("Log.findByUserIdType", userId, type);
	}

	public List<Log> findByUserId(long userId) {
		return super.executeFinder("Log.findByUserId", userId);
	}

	public Log getById(long id) {
		return super.read(id);
	}

	public void update(long id) {
		Log log = super.read(id);
		super.update(log);
	}

	public void delete(long id)// 真正删除
	{
		Log log = super.read(id);
		super.delete(log);
	}
}
